# -*- coding: utf-8 -*-
class PID:
    def __init__(self, Kp, Ki, Kd):
        self.Kp = Kp
        self.Ki = Ki
        self.Kd = Kd
        self.previous_error = 0
        self.integral = 0

    def update(self, error):
        # self.integral += error * dt
        # derivative = (error - self.previous_error) / dt
        output = self.Kp * error #+ self.Ki * self.integral + self.Kd * derivative
        # self.previous_error = error
        return output
